import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '门店ID',
    align:"center",
    sorter: true,
    dataIndex: 'storeId'
   },
   {
    title: '门店编码',
    align:"center",
    sorter: true,
    dataIndex: 'storeCode'
   },
   {
    title: '门店名称',
    align:"center",
    dataIndex: 'storeName'
   },
   {
    title: '所属平台',
    align:"center",
    dataIndex: 'platform_dictText'
   },
   {
    title: '平台名称',
    align:"center",
    dataIndex: 'platformName'
   },
   {
    title: '直营/代理',
    align:"center",
    dataIndex: 'businessType_dictText'
   },
   {
    title: '营运经理',
    align:"center",
    dataIndex: 'manager'
   },
   {
    title: '督导',
    align:"center",
    dataIndex: 'supervisor'
   },
   {
    title: '老板',
    align:"center",
    dataIndex: 'boss'
   },
   {
    title: '联系方式',
    align:"center",
    dataIndex: 'phoneNumber'
   },
   {
    title: '企微群名称',
    align:"center",
    dataIndex: 'wechatGroupName'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
  {
    label: "门店ID",
    field: "storeId",
    component: 'JInput',
  },
  {
    label: "门店编码",
    field: "storeCode",
    component: 'JInput',
  },
  {
    label: "门店名称",
    field: "storeName",
    component: 'JInput',
  },
	{
      label: "所属平台",
      field: 'platform',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"platfrom_takeout"
      },
      //colProps: {span: 6},
 	},
  {
    label: "平台名称",
    field: "platformName",
    component: 'JInput',
  },
	{
      label: "直营/代理",
      field: 'businessType',
      component: 'JSelectMultiple',
      componentProps:{
          dictCode:"business_type"
      },
      //colProps: {span: 6},
 	},
  {
    label: "营运经理",
    field: "manager",
    component: 'JInput',
  },
  {
    label: "督导",
    field: "supervisor",
    component: 'JInput',
  },
  {
    label: "老板",
    field: "boss",
    component: 'JInput',
  },
	{
      label: "企微群名称",
      field: 'wechatGroupName',
      component: 'Input',
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '门店ID',
    field: 'storeId',
    component: 'Input',
  },
  {
    label: '门店编码',
    field: 'storeCode',
    component: 'Input',
  },
  {
    label: '门店名称',
    field: 'storeName',
    component: 'Input',
  },
  {
    label: '所属平台',
    field: 'platform',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"platfrom_takeout"
     },
  },
  {
    label: '平台名称',
    field: 'platformName',
    component: 'Input',
  },
  {
    label: '直营/代理',
    field: 'businessType',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"business_type"
     },
  },
  {
    label: '营运经理',
    field: 'manager',
    component: 'Input',
  },
  {
    label: '督导',
    field: 'supervisor',
    component: 'Input',
  },
  {
    label: '老板',
    field: 'boss',
    component: 'Input',
  },
  {
    label: '联系方式',
    field: 'phoneNumber',
    component: 'Input',
  },
  {
    label: '企微群名称',
    field: 'wechatGroupName',
    component: 'Input',
  },
  {
    label: '机器人WebHook',
    field: 'robotWebhook',
    component: 'Input',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  storeId: {title: '门店ID',order: 0,view: 'text', type: 'string',},
  storeCode: {title: '门店编码',order: 1,view: 'text', type: 'string',},
  storeName: {title: '门店名称',order: 2,view: 'text', type: 'string',},
  platform: {title: '所属平台',order: 3,view: 'list', type: 'string',dictCode: 'platfrom_takeout',},
  platformName: {title: '平台名称',order: 4,view: 'text', type: 'string',},
  businessType: {title: '直营/代理',order: 5,view: 'list', type: 'string',dictCode: 'business_type',},
  manager: {title: '营运经理',order: 6,view: 'text', type: 'string',},
  supervisor: {title: '督导',order: 7,view: 'text', type: 'string',},
  boss: {title: '老板',order: 8,view: 'text', type: 'string',},
  phoneNumber: {title: '联系方式',order: 9,view: 'text', type: 'string',},
  wechatGroupName: {title: '企微群名称',order: 10,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}